#ifndef XSDL_H
#define XSDL_H
#pragma once
#include "xvideoview.h"
struct SDL_Window;
struct SDL_Renderer;
struct SDL_Texture;

class XSDL : public XVideoView
{
public:
    XSDL();
    bool InIt(int w, int h,
                      Format FMT = RGBA) override;
    //渲染图像
    bool Draw(const unsigned char * data, int linesize = 0) override;
    bool Draw(const unsigned char* y, int y_pitch,
                    const unsigned char* u, int u_pitch,
                    const unsigned char* v, int v_pitch) override;
    bool IsExit();
    void Close();
private:
        SDL_Window* win_ = nullptr;
        SDL_Renderer* Renderer  = nullptr;
        SDL_Texture* Texture = nullptr;
};

#endif // XSDL_H
